<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>CSD462 Library Documentation: lib/viewport.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CSD462 Library Documentation
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Computer Graphics</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">viewport.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef CSD462_VIEWPORT_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define CSD462_VIEWPORT_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;glew.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_c_s_d462.html">CSD462</a> {</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_c_s_d462_1_1_viewport.html">   14</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_s_d462_1_1_viewport.html">Viewport</a> {</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <a class="code" href="class_c_s_d462_1_1_viewport.html#a97e246c846936c692bbad909cfefb503">Viewport</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  <a class="code" href="class_c_s_d462_1_1_viewport.html#ad326daf50eeb2e3e830590ecdf9e8833">~Viewport</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="class_c_s_d462_1_1_viewport.html#a4cc5dbb553cbcb66d044744194064090">bind</a>( <span class="keywordtype">char</span> *buffer, <span class="keywordtype">size_t</span> w, <span class="keywordtype">size_t</span> h );</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="class_c_s_d462_1_1_viewport.html#aa1b6fb95159cf0051cacb3261fdf9c3e">update</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  <span class="keywordtype">size_t</span> w, h;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  <span class="keywordtype">void</span> *pixels;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  GLuint vertex_buffer;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  GLuint uv_buffer;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  GLuint texture;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  GLuint textureID;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  GLuint program;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  GLuint compile_shaders( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;  GLuint make_buffer( GLenum target, </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                      GLsizei buffer_size,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                      <span class="keyword">const</span> <span class="keywordtype">void</span> *buffer_data );</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  GLuint make_texture_rgb( <span class="keywordtype">void</span>* pixel_buffer, </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                           <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                           <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height );</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  GLuint make_texture_rgba( <span class="keywordtype">void</span>* pixel_buffer, </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                            <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                            <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height );</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="keywordtype">void</span> update_texture_rgb( GLuint textureID,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                           <span class="keywordtype">void</span>* pixel_buffer, </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                           <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                           <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height );</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="keywordtype">void</span> update_texture_rgba( GLuint textureID,</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                            <span class="keywordtype">void</span>* pixel_buffer, </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                            <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                            <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height );</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;};</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;}; <span class="comment">// namespace CSD462</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#endif // CSD462_VIEWPORT_H</span></div>
<div class="ttc" id="class_c_s_d462_1_1_viewport_html_a97e246c846936c692bbad909cfefb503"><div class="ttname"><a href="class_c_s_d462_1_1_viewport.html#a97e246c846936c692bbad909cfefb503">CSD462::Viewport::Viewport</a></div><div class="ttdeci">Viewport(void)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> viewport.cpp:8</div></div>
<div class="ttc" id="class_c_s_d462_1_1_viewport_html_aa1b6fb95159cf0051cacb3261fdf9c3e"><div class="ttname"><a href="class_c_s_d462_1_1_viewport.html#aa1b6fb95159cf0051cacb3261fdf9c3e">CSD462::Viewport::update</a></div><div class="ttdeci">void update(void)</div><div class="ttdoc">Update the viewport. </div><div class="ttdef"><b>Definition:</b> viewport.cpp:69</div></div>
<div class="ttc" id="class_c_s_d462_1_1_viewport_html"><div class="ttname"><a href="class_c_s_d462_1_1_viewport.html">CSD462::Viewport</a></div><div class="ttdoc">Draws buffered image data as texture. </div><div class="ttdef"><b>Definition:</b> viewport.h:14</div></div>
<div class="ttc" id="class_c_s_d462_1_1_viewport_html_ad326daf50eeb2e3e830590ecdf9e8833"><div class="ttname"><a href="class_c_s_d462_1_1_viewport.html#ad326daf50eeb2e3e830590ecdf9e8833">CSD462::Viewport::~Viewport</a></div><div class="ttdeci">~Viewport(void)</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> viewport.cpp:48</div></div>
<div class="ttc" id="class_c_s_d462_1_1_viewport_html_a4cc5dbb553cbcb66d044744194064090"><div class="ttname"><a href="class_c_s_d462_1_1_viewport.html#a4cc5dbb553cbcb66d044744194064090">CSD462::Viewport::bind</a></div><div class="ttdeci">int bind(char *buffer, size_t w, size_t h)</div><div class="ttdoc">Bind the viewport to a bitmap buffer. </div><div class="ttdef"><b>Definition:</b> viewport.cpp:58</div></div>
<div class="ttc" id="namespace_c_s_d462_html"><div class="ttname"><a href="namespace_c_s_d462.html">CSD462</a></div><div class="ttdef"><b>Definition:</b> color.cpp:10</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Sep 1 2015 14:30:00 for CSD462 Library Documentation by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
